package org.point.dao.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.point.common.dao.impl.BaseDaoImpl;
import org.point.common.util.DoPage;
import org.point.dao.DeliveryInfoDao;
import org.point.dao.UserLoginDao;
import org.point.dao.UserSignDao;
import org.point.domain.ConvertRuleDetail;
import org.point.domain.DeliveryInfo;
import org.point.domain.UserLogin;
import org.point.domain.UserSign;
import org.point.domain.Users;
import org.springframework.stereotype.Repository;

/**
 * 
 * @ClassName: ConvertRuleDetailDaoImpl  
 * @Description: TODO(兑换规则明细数据实现类)  
 * @author Kenny_Z' szqiuk@gmail.com
 * @date 2016年10月23日 下午3:28:17  
 *
 */
@Repository("UserSignDao")
public class UserSignDaoImpl extends BaseDaoImpl<UserSign, Serializable> implements UserSignDao {

	private static final String SQLID_SEARCHFORUSERSIGNPAGE = "search_For_UserSign_page";
	private static final String SQLID_SEARCHFORUSERSIGNCOUNT = "search_For_UserSign_count";
	private static final String SQLID_SEARCHUSERSIGN = "search_userSign";

	/**
	 * 利用反射，获取mapper.xml的namespace
	 * <p>Title: </p>  
	 * <p>Description: </p>
	 */
	public UserSignDaoImpl() {
		namespace = super.getNamespace();
	}

	public List<UserSign> searchForUserSign(DoPage<UserSign> page) {
		List<UserSign> records = null;
		try {
			records = getSqlSession().selectList(namespace + SQLID_SEARCHFORUSERSIGNPAGE, page);
		} catch (Exception e) {
			throw new RuntimeException("查询数据总记录数错误！", e);
		}
		return records;
	}

	public Integer searchForUserSignCount(DoPage<UserSign> page) {
		Integer result = 0;
		try {
			result = getSqlSession().selectOne(namespace + SQLID_SEARCHFORUSERSIGNCOUNT, page);
		} catch (Exception e) {
			throw new RuntimeException("查询数据总记录数错误！", e);
		}
		return result;
	}

	public List<UserSign> searchUserSignMap(Map<String, Object> map) {
		List<UserSign> userSigns = getSqlSession().selectList(namespace + SQLID_SEARCHUSERSIGN);
		return userSigns;
	}
}
